In computers, application programs execute software instructions on a processor to perform work. Modem computers allow those instructions to be divided into discrete tasks for processing. In a multi-threaded computing environment, the tasks are assigned to multiple computing threads for processing. The threads perform the task and return results to the application program.
In a typical free-thread environment, any available thread can be used to process a task. Tasks are assigned to worker threads by provider threads executing thread manager instructions. There is no predefined relationship between a worker thread and a task or application.
Typically, the thread manager queues tasks into a single task queue. When a worker thread becomes available, the next task in the task queue is assigned to that worker thread on a first-in, first-out basis. On a busy system, the worker threads can all be busy at any particular time. As a result, new tasks cannot be immediately assigned to a thread. This causes the single queue to become populated with waiting tasks.